//
//  BaseViewController.swift
//  WBPoject
//
//  Created by WorkSpace on 15/10/18.
//  Copyright © 2015年 商刻. All rights reserved.
//

import UIKit

class BaseViewController: UITableViewController,VistorLoginViewDelegate {

    var userLogin = false
    var vistorLoginView = VistorLoginView?()
    
    override func loadView() {
        
        if userLogin {
        
            super.loadView()
            return;
        }
        
        userLogin = true
        
        vistorLoginView = NSBundle.mainBundle().loadNibNamed("VistorLoginView", owner: nil, options: nil).last as? VistorLoginView
        vistorLoginView?.delegete = self
        view = vistorLoginView
        
        print("\(self.navigationController)", terminator: "")
        
        self.navigationItem.leftBarButtonItem = UIBarButtonItem.init(title: "注册", style: UIBarButtonItemStyle.Plain, target: self, action: "clickedRegisterBtn")
        self.navigationItem.rightBarButtonItem = UIBarButtonItem.init(title: "登录", style: UIBarButtonItemStyle.Plain, target: self, action: "clickedLoginBtn")
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    func clickedLoginBtn() {
        print("\(__FUNCTION__)", terminator: "")
    }
    
    func clickedRegisterBtn() {
        print("\(__FUNCTION__)", terminator: "")
    }

}
